<template>
  <div class="cart">
<<<<<<< HEAD
    <!-- 导航 -->
    <nav-bar class="nav-bar">
      <div slot="center">
        购物车(
        <span>{{ cartLength }}</span>
        )
      </div>
    </nav-bar>
    <!-- 购物车列表 -->
    <cart-list />
=======
    <nav-bar class="nav-bar">
      <div slot="center">购物车({{cartLength}})</div>
    </nav-bar>
    <cart-list/>
    <cart-bottom-bar/>
>>>>>>> f1nal
  </div>
</template>

<script>
<<<<<<< HEAD
import NavBar from "@/components/common/navbar/NavBar";
import CartList from "./children/CartList";
import { mapGetters } from "vuex";

export default {
  name: "Cart",
  computed: {
    // 对象写法可以自己命名
    ...mapGetters({
      cartLength: "cartListLength"
    })
  },
  components: { CartList, NavBar }
};
</script>

<style scoped>
.nav-bar {
  font-weight: 600;
  color: white;
  background-color: #ff8198;
=======
import { mapGetters } from 'vuex'

import NavBar from 'components/common/navbar/NavBar'
import CartList from './childComps/CartList'
import CartBottomBar from './childComps/CartBottomBar'
  export default {
    name: "Cart",
    components: {
      NavBar,
      CartList,
      CartBottomBar
    },
    computed: {
      ...mapGetters(['cartLength', 'cartList'])
      }
    
  }
</script>

<style scoped>
.cart {
  height: 100vh;
}

.nav-bar {
  background-color: var(--color-tint);
  color: #fff;
  font-weight: 700;
>>>>>>> f1nal
}
</style>
